{% extends 'base.html' %}
{% load i18n %}

{% block container %}
    <div class="content">
    {% if validlink %}
        {% if form.errors %}
            <div class="alert alert-danger">
                <a class="close" data-dismiss="alert" href="#">×</a>
                <p>{% blocktrans count form.errors.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}</p>
                <script type="text/javascript">
                    $(document).ready(function(){
                        $(".alert-message").alert();
                    });
                </script>
            </div>
        {% endif %}
        <form action="" method="post">{% csrf_token %}
            <fieldset>
                <legend>{% trans 'Password reset unsuccessful' %}</legend>
                <div class="clearfix">
                    <div class="input">
                        {% trans "Please enter your new password twice so we can verify you typed it in correctly." %}
                    </div>
                </div>
                {% for field in form %}
                    {% include 'registration/form_field.html' %}
                {% endfor %}
                <div class="actions">
                    <input type="submit" class="btn primary" value="{% trans 'Change my password' %}">
                </div>
            </fieldset>
            <script type="text/javascript">
                document.forms[1].elements[2].focus();
            </script>
        </form>
    {% else %}
        <h3>{% trans 'Password reset unsuccessful' %}</h3>
        <p>
            {% trans "The password reset link was invalid, possibly because it has already been used.  Please request a new password reset." %}
        </p>
    {% endif %}
    </div>
{% endblock %}